Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

predicates/traffic: speedup TrafficSegment tests #2509

Merged

Conversation

AlexanderYastrebov
Copy link
Member

TrafficSegment tests perform 10k test requests per test case.

Add inlineContent("") to test routes to have Content-Length: 0 response header that disables chunked encoding and speeds up the tests.

Before:

go test ./predicates/traffic/ -count=1 -run=TestTrafficSegment
ok      github.com/zalando/skipper/predicates/traffic   8.928s

After:

go test ./predicates/traffic/ -count=1 -run=TestTrafficSegment
ok      github.com/zalando/skipper/predicates/traffic   4.285s

To further speedup make test requests in parallel:

go test ./predicates/traffic/ -count=1 -run=TestTrafficSegment
ok      github.com/zalando/skipper/predicates/traffic   1.554s

See related #2459 #1562

TrafficSegment tests perform 10k test requests per test case.

Add `inlineContent("")` to test routes to have `Content-Length: 0`
response header that disables chunked encoding and speeds up the tests.

Before:
```
go test ./predicates/traffic/ -count=1 -run=TestTrafficSegment
ok      github.com/zalando/skipper/predicates/traffic   8.928s
```

After:
```
go test ./predicates/traffic/ -count=1 -run=TestTrafficSegment
ok      github.com/zalando/skipper/predicates/traffic   4.285s
```

To further speedup make test requests in parallel:
```
go test ./predicates/traffic/ -count=1 -run=TestTrafficSegment
ok      github.com/zalando/skipper/predicates/traffic   1.554s
```

See related #2459 #1562

Signed-off-by: Alexander Yastrebov <[email protected]>
@szuecs
Copy link
Member

szuecs commented Aug 10, 2023

👍

1 similar comment
@AlexanderYastrebov
Copy link
Member Author

👍

@AlexanderYastrebov AlexanderYastrebov merged commit 91851ea into master Aug 10, 2023
6 checks passed
@AlexanderYastrebov AlexanderYastrebov deleted the predicates/traffic/speedup-segment-tests-2 branch August 10, 2023 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants